﻿using Super_Management_Mayhem.Content.Spritesheet;
using Super_Management_Mayhem.Screens.Playing.Players;
using Transformable_Engine_v2.Engine.GameObjects.Containers;
using Transformable_Engine_v2.Engine.GameObjects.Containers.Transformable_controls;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Menu.SelectTeams
{
    public class TeamButton : Container
    {
        public TeamButton(Team team)
        {
            AddChildren(new ImageContainer {
                                               Sprite = MenuSheet.GetSprite(MenuSheet.Button.Background),
                                               Origin = TE_Rectangle.Alignment.CenterMiddle,
                                               Scale = new TE_Vector2(2, 2)
                                           });

            AddChildren(new ImageContainer {
                                               Sprite = MenuSheet.GetSprite(MenuSheet.Button.Foreground),
                                               Origin = TE_Rectangle.Alignment.CenterMiddle,
                                               Color = team.GetColor(),
                                               Scale = new TE_Vector2(2, 2)
                                           });

            AddChildren(new Label(MenuSheet.GetInstance().GetSpriteAlphabet<MenuSheet.LetterAlphabet>, team.Name) {
                                                                                                                      TextAlign = TE_Rectangle.Alignment.CenterMiddle
                                                                                                                  });

            base.LoadContent();
        }
    }
}